package cn.edu.buu.news.service.impl;

import cn.edu.buu.news.entity.User;
import cn.edu.buu.news.mapper.AdminMapper;
import cn.edu.buu.news.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;

    @Override
    public void add(User admin) {
        adminMapper.insert(admin);
    }
    @Override
    public User findAdmin(String userName, String password) {
        return this.adminMapper.selectAdmin(userName,password);
    }
}
